package cn.study.vue_project_xxx.common.result;

import cn.study.vue_project_xxx.util.InstanceFactoryUtil;
import lombok.Data;

@Data
public class ResultSet<T> {

    private Integer code;
    private T data;
    private String message;

    public static <T> ResultSet<T> success(T data) {
        ResultSet<T> resultSet = new ResultSet<>();
        resultSet.setData(data);
        resultSet.setCode(2000);
        return resultSet;
    }
    public static  ResultSet<Object> fail(String message) {
        ResultSet<Object> resultSet = new ResultSet<>();
        resultSet.setCode(5000);
        resultSet.setMessage(message);
        return resultSet;
    }

}
